//Usage:
// {
//   "str" : "example"
// }
//return: 字符串的md5值

// 云函数入口文件
const cloud = require('wx-server-sdk')
var utilMd5 = require('md5.js')
cloud.init()

// 云函数入口函数
exports.main = async (event, context) => {
  const wxContext = cloud.getWXContext()
  var md5string = utilMd5.hexMD5(event.str)
  console.log(md5string)
  return md5string
}